<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       Cake.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
//$cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework');
$users = $this->Session->read('Auth.User');
    
?>
<!DOCTYPE html>
<html>
    <head>
        <?php echo $this->Html->charset(); ?>
        <title><?php echo $title_for_layout; ?> - www.truenewsworld.com</title>
        <?php
        echo $this->Html->meta('icon');

        // echo $this->Html->css('cake.generic');
        echo $this->Html->css(array('bootstrap', 'default'));
        echo $this->Html->script(array('jquery', 'bootstrap'));
        echo $this->Html->script('/TinyMCE/js/tiny_mce/tiny_mce.js', array('inline' => false));

        echo $this->fetch('meta');
        echo $this->fetch('css');
        echo $this->fetch('script');
        //echo $this->Html->script(array(''))        
        ?>
    </head>
    <body>
        <?php 
            //pr($this->request->params);
        ?>
        <div id="container">
            <div id="nav_top">
                <div>
                    <ul>
                        <?php if(!isset($users)){ ?>
                        <li><?php echo $this->Html->link(__('Plan & Sign Up'), array('controller' => 'subscribe', 'action' => 'plans')) ?></li>
                        <li><?php echo $this->Html->link(__('Sign In'), array('controller' => 'users', 'action' => 'login')) ?></li>                        
                        <?php }else{ ?>
                        <li><a class="welcome_user"><?php echo __('Welcome, ',true) . $users['username'] ?></a></li>
                        <li><?php echo $this->Html->link(__('Sign Out'), array('controller' => 'users', 'action' => 'logout')) ?></li>
                        <?php } ?>
                    </ul>
                </div>
            </div>
            <div id="n_wrapper">
                <div id="n_header">
                    <div class="n_logo">
                        <?php echo $this->Html->image("TrueNews.png", array('alt' => 'Logo', 'width' => '252', 'height' => '182', 'url' => BASE_URL)); ?>
                    </div>
                    <div class="n_adv_top">               
                    <?php                     
                        echo $this->element('flash_banner');
                    ?>
                    </div>
                    <div class="n_menu">
                        <?php
                            //$page = pathinfo($_SERVER['REQUEST_URI'],PATHINFO_BASENAME);
                            
                            $action = $this->request->params['action'];
                            
                            $act = "active";                            
                            switch($action){
                                case 'about':
                                    $about = $act;
                                    break;
                                case 'service':
                                    $service = $act;
                                    break;
                                case 'latest':
                                    $latest = $act;
                                    break;
                                case 'faq':
                                    $faq = $act;
                                    break;
                                case 'contact':
                                    $contact = $act;
                                    break;                                    
                                default:
                                    $home = $act;
                                    break;
                                    
                            }
                        ?>
                        <ul>
                            <li><?php echo $this->Html->link(__('Home'),'/', array('class' => @$home)) ?></li>
                            <li><?php echo $this->Html->link(__('About Us'),array('controller' => 'pages', 'action' => 'about'),array('class' => @$about)) ?></li>
                            <li><?php echo $this->Html->link(__('Services'),array('controller' => 'pages', 'action' => 'service'),array( 'class' => @$service)) ?></li>
                            <li><?php echo $this->Html->link(__('Latest'),array('controller' => 'articles', 'action' => 'latest'),array('class' => @$latest)) ?></li>
                            <li><?php echo $this->Html->link(__('FAQ'),array('controller' => 'pages', 'action' => 'faq'),array( 'class' => @$faq)) ?></li>
                            <li><?php echo $this->Html->link(__('Contact Us'),array('controller' => 'pages', 'action' => 'contact'),array( 'class' => @$contact)) ?></li>
                        </ul>
                    </div>
                </div>
                <div id="n_content">
                    <div class="n_adv_left">
      
                                <ul class="ul_adv_list clear-margin-bt ini_min_hieght_rt">
                                    <li><?php echo $this->Html->image('img_adv_left.png', array('width' => 200, 'height' => 152)) ?></li>
                                    <li><?php echo $this->Html->image('img_adv_left2.png', array('width' => 200, 'height' => 133)) ?></li>
                                    <li><?php echo $this->Html->image('img_adv_left3.png', array('width' => 200, 'height' => 128)) ?></li>
                                    <li><?php echo $this->Html->image('img_adv_left4.png', array('width' => 200, 'height' => 150)) ?></li>
                                    <li><?php echo $this->Html->image('img_adv_left5.png', array('width' => 200, 'height' => 200)) ?></li>
                                </ul>            

                    </div>
                    <div class="n_middle" id="n_middle"> 
                        <?php echo $this->Session->flash(); ?>
                        <?php echo $this->fetch('content'); ?>

                    </div><!-- #n_middle -->

                    <div class="n_adv_right">
                        <div class="box-right">
                                <!-- <form action="" method="post" class="frm_search"> -->
                                    <!--<input type="text" class="txt_search" name="txt_search" />
                                    <input type="submit" value="" class="btn_search" />-->
                                    <div id="cse-search-form" style="width: 100%;">Loading</div>
                                    <script src="http://www.google.com/jsapi" type="text/javascript"></script>
                                    <script type="text/javascript"> 
                                      google.load('search', '1', {language : 'en', style : google.loader.themes.V2_DEFAULT});
                                      google.setOnLoadCallback(function() {
                                        var customSearchOptions = {};  var customSearchControl = new google.search.CustomSearchControl(
                                          '014343510369970654058:894obogy97a', customSearchOptions);
                                        customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
                                        var options = new google.search.DrawOptions();
                                        options.enableSearchboxOnly("<?php echo BASE_URL ?>search/");
                                        customSearchControl.draw('cse-search-form', options);
                                      }, true);
                                    </script>
                               <!-- </form> -->
                        </div>

                        <div class="box-right">
                                <?php echo $this->Html->link(__('Subscribe'), array('controller' => 'subscribe', 'action' => 'plans'), array('class' => 'btn btn-success btn-large', 'id' => 'subscride')) ?>
                        </div>

                        
                        <ul class="ul_adv_list clear-margin-bt ini_min_hieght">
                            <li class="n_adv_title"><?php echo __('Advertisment') ?></li>
                            <li><?php echo $this->Html->image('img_adv_right.png', array('width' => 200, 'height' => 165)) ?></li>
                            <li><?php echo $this->Html->image('img_adv_right2.png', array('width' => 200, 'height' => 95)) ?></li>
                            <li><?php echo $this->Html->image('img_adv_right3.png', array('width' => 200, 'height' => 144)) ?></li>
                            <li><?php echo $this->Html->image('img_adv_right4.png', array('width' => 200, 'height' => 200)) ?></li>
                        </ul>


                    </div> <!-- .n_adv_right -->       
                </div><!-- #n_content -->
                <div id="n_footer">
                    <div class="n_f_left">
                        <span>Copyright © 2012 True News World. All Rights Reserved.</span>
                    </div>
                    <div class="n_f_right">
                        <ul>
                            <li><?php echo $this->Html->link(__('About Us'),array('controller' => 'pages', 'action' => 'about')) ?></li>
                            <li><?php echo $this->Html->link(__('Contact Us'),array('controller' => 'pages', 'action' => 'contact')) ?></li>
                            <li><?php echo $this->Html->link(__('Advertise with Us'), '#') ?></li>
                            <li><?php echo $this->Html->link(__('Terms & Conditions'),array('controller' => 'pages', 'action' => 'term')) ?></li>
                        </ul>
                    </div>
                    <?php echo $this->element('sql_dump'); ?>
                </div>
            </div>            
        </div>    
        <?php
            echo $this->Html->css('google-search');
        ?>
        <script>
            $(document).ready(function() {
                $('input.gsc-input').css('background', 'none');
            })
        </script>
    </body>
</html>
